<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<#include "/jspgou_sys/head.html"/>
<script type="text/javascript">
function getTableForm() {
	return document.getElementById('tableForm');
}
</script>
</head>
<body>
<div class="body-box">
<div class="rhead">
	<div class="rpos"><@s.m "global.position"/>: 销售统计 - 销量排行　　
	 </div>
	
	<form class="ropt">
	<input type="hidden" name="pageNo" value="${pageNo!}"/>
	<input type="hidden" name="ctgId" value="${ctgId!}"/>
	<select name="typeid">
	<#list types as type>
	<option value="${type.id}" <#if (typeid!?string)==type.id?string>selected="selected"</#if>>${type.name}</option>
	</#list>
	</select>　
	<input type="submit" onclick="this.form.action='v_productProfitTop.do';" value="查看">
	</form>
	<div class="clear"></div>
</div>
<form id="tableForm" method="post">
<input type="hidden" name="pageNo" value="${pageNo!}"/>
<input type="hidden" name="ctgId" value="${ctgId!}"/>
<input type="hidden" name="typeid" value="${typeid!}"/>
<@p.table listAction="v_productProfitTop.do" value=list;product,i,has_next><#rt/>
	<#--<@p.column title="ID" width="20">${product[0].id}</@p.column>--><#t/>
	<@p.column code="product.name">${product[0].name}</@p.column><#t/>
	<@p.column code="product.category">${product[0].category.name}</@p.column><#t/>
	<@p.column code="product.type">${product[0].type.name}</@p.column><#t/>
	<@p.column code="总销售量">${product[1]}</@p.column><#t/>
	<@p.column code="总利润">${product[2]}</@p.column><#t/>
	<@p.column code="库存">${product[0].stockCount}</@p.column><#t/>
	<#--
	<@p.column code="global.operate" align="center">
		xxx
	</@p.column><#t/>
	-->
</@p.table>
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td align="center" class="pn-sp">
	共 ${totalCount} 条&nbsp;
	每页<input type="text" name="pageSize" value="${pageSize}" style="width:30px" onfocus="this.select();" onblur="$.cookie('_cookie_page_size',this.value,{expires:3650});" onkeypress="if(event.keyCode==13){$(this).blur();return false;}"/>条&nbsp;
	<input type="button" value="首 页" onclick="_gotoPage('1');"<#if pageNo==1> disabled="disabled"</#if>/>
	<input type="button" value="上一页" onclick="_gotoPage('${pageNo-1}');"<#if pageNo==1> disabled="disabled"</#if>/>
	<input type="button" value="下一页" onclick="_gotoPage('${pageNo+1}');"<#if pageNo==totalPage> disabled="disabled"</#if>/>
	<input type="button" value="尾 页" onclick="_gotoPage('${totalPage}');"<#if pageNo==totalPage> disabled="disabled"</#if>/>&nbsp;
	当前 ${pageNo}/${totalPage} 页 &nbsp;转到第<input type="text" id="_goPs" style="width:50px" onfocus="this.select();" onkeypress="if(event.keyCode==13){$('#_goPage').click();return false;}"/>页
	<input id="_goPage" type="button" value="转" onclick="_gotoPage($('#_goPs').val());"<#if totalPage==1> disabled="disabled"</#if>/>
</td></tr></table>
<script type="text/javascript">
function _gotoPage(pageNo) {
	try{
		var tableForm = getTableForm();
		$("input[name=pageNo]").val(pageNo);
		tableForm.action="v_productProfitTop.do";
		tableForm.onsubmit=null;
		tableForm.submit();
	} catch(e) {
		alert('_gotoPage(pageNo)方法出错');
	}
}
</script>


</form>
</div>
<#include "/common/alert_message.html"/>
</body>
</html>